Register Allocation via Coloring of Chordal Graphs
نویسنده
چکیده
We present a simple algorithm for register allocation which is competitive with the iterated register coalescing algorithm of George and Appel. We base our algorithm on the observation that 95% of the methods in the Java 1.5 library have chordal interference graphs when compiled with the JoeQ compiler. A greedy algorithm can optimally color a chordal graph in time linear in the number of edges, and we can easily add powerful heuristics for spilling and coalescing. Our experiments show that the new algorithm produces better results than iterated register coalescing for settings with few registers and comparable results for settings with many registers.
منابع مشابه
Approximations for Aligned Coloring and Spillage Minimization in Interval and Chordal Graphs
We consider the problem of aligned coloring of interval and chordal graphs. These problems have substantial applications to register allocation in compilers and have recently been proven NP-Hard. We provide the first constant approximations: a 4 3 -approximation for interval graphs and a 3 2 -approximation for chordal graphs. We extend our techniques to the problem of minimizing spillage in the...
متن کاملRegister allocation for programs in SSA form
As register allocation is one of the most important phases in optimizing compilers, much work has been done to improve its quality and speed. We present a novel register allocation architecture for programs in SSA-form which simplifies register allocation significantly. We investigate certain properties of SSA-programs and their interference graphs, showing that they belong to the class of chor...
متن کاملRegister Allocation via Chordal Graph Coloring for a HOT Compiler
[Note: this is an early draft of this write-up. A more polished version with citations and so forth is on the way shortly.] The problem of creating efficient type-preserving compilers for programming langauges with higherorder functions and rich type systems (HOT) has been studied with great interest in recent years, particularly at CMU. In Fall 2005, a course on HOT Compilation was offered for...
متن کاملRegister Allocation After Classical SSA Elimination is NP-Complete
Chaitin proved that register allocation is equivalent to graph coloring and hence NP-complete. Recently, Bouchez, Brisk, and Hack have proved independently that the interference graph of a program in static single assignment (SSA) form is chordal and therefore colorable in linear time. Can we use the result of Bouchez et al. to do register allocation in polynomial time by first transforming the...
متن کاملOptimistic chordal coloring: a coalescing heuristic for SSA form programs
The interference graph for a procedure in Static Single Assignment (SSA) Form is chordal. Since the k-colorability problem can be solved in polynomial-time for chordal graphs, this result has generated interest in SSA-based heuristics for spilling and coalescing. Since copies can be folded during SSA construction, instances of the coalescing problem under SSA have fewer affinities than traditio...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2005